<?php
namespace Home\Model;

class ResourceModel extends CommonModel{
    
    //根据分类获取资源
    public function getResByType($type,$pid = 0){
        $res = array();
        $list = $this->where(array('type'=>$type,'pid'=>$pid))->select();
        foreach($list as $v){
            $res[$v['id']] = $v['name'];
        }
        return $res;
    }
    
}